<!doctype html>
<html>
  <head>
    <title>Socket.IO chat</title>
    <style>
      * { margin: 0; padding: 0; box-sizing: border-box; }
      body { font: 13px Helvetica, Arial; }
      form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }
      form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }
      form div { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }
      #messages { list-style-type: none; margin: 0; padding: 0; }
      #messages li { padding: 5px 10px; }
      #messages li:nth-child(odd) { background: #eee; }
    </style>
	<script src="/socket.io/socket.io.js"></script>
	<script>
	
	  var socket = io();
	  
	  function sent(){
	  
	  
	  var ws = new WebSocket("ws://127.0.0.1:3330");

      // 建立 web socket 连接成功触发事件
      ws.onopen = function () {
        // 使用 send() 方法发送数据
        ws.send("发送数据");
        console.log("数据发送中...");
      };

      // 接收服务端数据时触发事件
      ws.onmessage = function (evt) {
        var received_msg = evt.data;
        console.log("数据已接收...");
      };
	  }
	</script>
  </head>
  <body>
    <ul id="messages"></ul>
	
	ws:localhost:prot?aaa=value
    <form action="">
      <input id="m"  name="aaa" autocomplete="off" />
	  <div>Send</button>
    </form>
	
  </body>
</html>